<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改【请填写功能名称】')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal" id="form-experiment-edit" th:object="${onlineExperimentTea}">
        <input name="experimentTeaId" th:field="*{experimentTeaId}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">布置的实验的名称：</label>
            <div class="col-sm-8">
                <input name="experimentTeaName" th:field="*{experimentTeaName}" class="form-control" type="text" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">开始时间：</label>
            <div class="col-sm-8">
                <input name="experimentTeaBeginTime" id="experimentTeaBeginTime" th:value="${#dates.format(onlineExperimentTea.experimentTeaBeginTime,'yyyy-MM-dd')}" readonly class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">结束时间：</label>
            <div class="col-sm-8">
                <input name="experimentTeaEndTime" id="experimentTeaEndTime" th:value="${#dates.format(onlineExperimentTea.experimentTeaEndTime,'yyyy-MM-dd')}" class="form-control" type="text">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script type="text/javascript">
    $(function () {
        /*$("#experimentTeaBeginTime").datetimepicker({
            format: 'yyyy-mm-dd',
            minView: 2,
            autoclose: true, //选择后自动关闭
            todayBtn: true,  //显示今天按钮
        })*/
        $("#experimentTeaEndTime").datetimepicker({
            format: 'yyyy-mm-dd',
            minView: 2,
            autoclose: true, //选择后自动关闭
            todayBtn: true,  //显示今天按钮
        })
    })
    var prefix = ctx + "/system/OnlineExperimentStu";
    $("#form-experiment-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            if($("#experimentTeaEndTime").val()<=$("#experimentTeaBeginTime").val()){
                $.modal.msg("请选择结束时间大于开始时间");
            }else{
                $.operate.save(prefix + "/editSaveTime", $('#form-experiment-edit').serialize());
            }
        }
    }
</script>
</body>
</html>